<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>面向对象之this的用法</title>
</head>
<body>

<script>
    function A() {
        this.phone = 'iphone';
        console.log('A的this是'.this);//通过构造函数生成一个新对象，this指向的新对象
    }
    var a = new A();//  a
    console.log('a的手机是'+a.phone);

    var b = new A();//   b
    console.log('b的手机是'+b.phone);
</script>
</body>
</html>